# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=softflowd
pkgver=1.1.0
pkgrel=0
pkgdesc="A software NetFlow probe"
url="https://github.com/irino/softflowd"
arch="all"
license="BSD-2-Clause"
options="!check"
makedepends="autoconf automake libtool libpcap-dev"
subpackages="$pkgname-openrc $pkgname-doc"
source="https://github.com/irino/softflowd/archive/softflowd-v$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	"
builddir="$srcdir/softflowd-softflowd-v$pkgver"

prepare() {
	default_prepare
	autoreconf -vfi
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="
ab4f5df35d5ff7591c6e0b92ae6c41c977b107e1e5777429d2d7c637cadd3cdff3ca0ed560ada54af449c33429739117499a898b405d2f50eb9d0ee048b25983  softflowd-v1.1.0.tar.gz
a049158fe474bb76e497613a7e2109b92047a37210bfe695b18b50cf7f5be5407896a11927d685fc03dec899c50bd6dbfeffdccf8e918ba515cfcab5dbd2b2a9  softflowd.initd
10b536cb5d32edbfe5d1a09e2b4ded4d95cb2bbfbe44cdcf267958efe1cde440f0caf4f60e41b4a59164a471bf430527912daf2c47df42f0dc47997352689e5d  softflowd.confd
"
